package de.koller.nadir.render.robj;

import de.koller.aframe.gl.AVertexBuffer;
import de.koller.nadir.render.NRender;
import org.lwjgl.opengl.GL11;

public class Floor {
	
	private final AVertexBuffer vbo = new AVertexBuffer( AVertexBuffer.UsageType.Dynamic, GL11.GL_QUADS );
	private boolean initalized = false;

	public void init() {
		vbo.setup( 3, 0, 0, 2 );
		vbo.setData(  0,  0, 0, 0, 0,
					  0, -1, 0, 0, 1,
					  1, -1, 0, 1, 1,
					  1,  0, 0, 1, 0 );
		initalized = true;
	}
	
	public void render( NRender render ) {
		if( !initalized )
			init();
		
		render.textures.grid.bind();
		vbo.renderThis();
	}
	
}
